package com.woniu.woniuYoga.comm.core.exception;

import lombok.Builder;
import lombok.Data;

/**
 * @author: 付宽成
 * @description: ResultError 自定义异常结果封装类
 * @date: 2020/8/17 22:51
 * @version: 1.0
 */

@Data
@Builder
public class ResultError {
    private Integer code;
    private String msg;

    public static ResultError error(WoniuExceptionCode code){
        return ResultError.builder().code(code.getCode()).msg(code.getMsg()).build();
    }


    public static ResultError errorExec(WoniuException e){
        return ResultError.builder().code(e.getCode()).msg(e.getMessage()).build();
    }

}
